/**
 * Test of DataSetLoader class
 *
 * author: Marcin Wachulski
 *
 */
#include "DataStructure.h"
#include "DataSetLoader.h"
#include "gtest\gtest.h"
#include <iostream>

class DataSetLoader : public testing::Test {
public:
};

TEST_F(DataSetLoader, a) {
    DataStructure *data = loadDataSet("../datasets/a.dat");
    EXPECT_EQ(8, data->getAllAtributes()->data.size());
    EXPECT_EQ(6, data->getAllObjects()->data.size());
    data->printSummary(std::cout);
    delete data;
}

TEST_F(DataSetLoader, chess) {
    DataStructure *data = loadDataSet("../datasets/chess.dat");
    EXPECT_EQ(75, data->getAllAtributes()->data.size());
    EXPECT_EQ(3196, data->getAllObjects()->data.size());
    data->printSummary(std::cout);
    delete data;
}

TEST_F(DataSetLoader, mushroom) {
    DataStructure *data = loadDataSet("../datasets/mushroom.dat");
    EXPECT_EQ(119, data->getAllAtributes()->data.size());
    EXPECT_EQ(8124, data->getAllObjects()->data.size());
    data->printSummary(std::cout);
    delete data;
}

TEST_F(DataSetLoader, T10I4D100K) {
    DataStructure *data = loadDataSet("../datasets/T10I4D100K.dat");
    EXPECT_EQ(870, data->getAllAtributes()->data.size());
    EXPECT_EQ(100000, data->getAllObjects()->data.size());
    data->printSummary(std::cout);
    delete data;
}

TEST_F(DataSetLoader, connect) {
    DataStructure *data = loadDataSet("../datasets/connect.dat");
    EXPECT_EQ(129, data->getAllAtributes()->data.size());
    EXPECT_EQ(67557, data->getAllObjects()->data.size());
    data->printSummary(std::cout);
    delete data;
}

TEST_F(DataSetLoader, pumsb_star) {
    DataStructure *data = loadDataSet("../datasets/pumsb_star.dat");
    EXPECT_EQ(2088, data->getAllAtributes()->data.size());
    EXPECT_EQ(49046, data->getAllObjects()->data.size());
    data->printSummary(std::cout);
    delete data;
}

TEST_F(DataSetLoader, T40I10D100K) {
    DataStructure *data = loadDataSet("../datasets/T40I10D100K.dat");
    EXPECT_EQ(942, data->getAllAtributes()->data.size());
    EXPECT_EQ(100000, data->getAllObjects()->data.size());
    data->printSummary(std::cout);
    delete data;
}

TEST_F(DataSetLoader, pubsb) {
    DataStructure *data = loadDataSet("../datasets/pumsb.dat");
    EXPECT_EQ(2113, data->getAllAtributes()->data.size());
    EXPECT_EQ(49046, data->getAllObjects()->data.size());
    data->printSummary(std::cout);
    delete data;
}

